package com.qf.compusdemo.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.compusdemo.dao.WxsDao;
import com.qf.compusdemo.entity.Wxs;
import com.qf.compusdemo.service.WxsService;
import com.qf.compusdemo.vo.Ppage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WxsServiceImpl extends ServiceImpl<WxsDao, Wxs> implements WxsService {

    @Autowired
    private WxsDao wxsDao;

    @Override
    public int insertWxs(Wxs wxx) {
       return wxsDao.insertWx(wxx);
    }

    @Override
    public IPage<Wxs> getAllwx(Page<Wxs> page, Wxs bb) {
        QueryWrapper<Wxs> wrapper=new QueryWrapper<>();
        wrapper.eq("types",bb.getTypes());
        if(bb.getGgmessage()!=null){
            wrapper.like("ggmessage",bb.getGgmessage());
        }
        IPage<Wxs>ipage= wxsDao.selectPage(page,wrapper);
        System.out.println(ipage);
        return ipage;
    }

    @Override
    public int delwx(List lists) {
       return wxsDao.deleteBatchIds(lists);
    }


}
